package concurrency.part1.task3;

public class Consumer implements Runnable {
    private final Buffer<Object> buffer;
    private final String name;

    public Consumer(String name,Buffer<Object> buffer) {
        this.buffer = buffer;
        this.name=name;
    }

    @Override
    public void run() {
        while (!Thread.currentThread().isInterrupted()){
            buffer.get();
        }
    }
}
